package joc.contract;

import joc.customize.Contract;
import joc.customize.PartialEvaluationResult;
import joc.customize.ForFieldEvaluateAtBeginningOfAllMethods;
import joc.customize.ForFieldEvaluateAtEndOfAllBehaviors;
import joc.customize.ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit;
import joc.customize.ForParameterEvaluateAtBeginningOfBehavior;

public class GreaterThanLongContract extends Contract<GreaterThanLong> {
	@ForFieldEvaluateAtBeginningOfAllMethods
	@ForFieldEvaluateAtEndOfAllBehaviors
	@ForParameterEvaluateAtBeginningOfBehavior
	@ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit
	public PartialEvaluationResult checkContract(GreaterThanLong annotation, long value) {
		return getResult(value > annotation.value(), "Value " + value + " is not greater than " + annotation.value()
				+ ".");
	}

}
